package interfaz2;

import java.io.File;
import java.io.FileNotFoundException;

import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;

/**
 * This class contains a variety of statics methods to help with common
 * logic for the interface.
 * 
 * @author ole
 */
public final class IfaceUtils {
	public static Image buildImage(String fname) throws FileNotFoundException {
		Image img;
		File fd;
		
		fd = new File(fname);
		if (!fd.exists())
			throw new FileNotFoundException("File " + fname + " doesn't " +
											"exists.");
		
		img = new Image(Display.getDefault(), fname);
		return img;
	}
}
